#include "GoalWindow.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QMessageBox>



GoalWindow::GoalWindow(QWidget *parent, Bridget *bd) :
        QWidget(parent)/*,
        addGoalButton(tr("Save"), this)*/

{
    inputWeight.setText(QString::number(bd->getGoalWeight()));
    inputSpend.setText(QString::number(bd->getFitnessPlan()));

    QHBoxLayout *lCurW=new QHBoxLayout;
    QLabel *curWLab= new QLabel(this);
    curWLab->setText("Your current weight, kg:");
    curW= new QLabel(this);
    curW->setText(QString::number(bd->getWeight()));
    lCurW->addWidget(curWLab);
    lCurW->addWidget(curW);

    QHBoxLayout *lIdealW=new QHBoxLayout;
    QLabel *idealWLab= new QLabel(this);
    idealWLab->setText("Ideal weight for you, kg:");
    idealW= new QLabel(this);
    idealW->setText(QString::number(bd->getIdealWeight()));
    lIdealW->addWidget(idealWLab);
    lIdealW->addWidget(idealW);

    QVBoxLayout *inf=new QVBoxLayout;
    inf->addLayout(lCurW);
    inf->addLayout(lIdealW);



    QVBoxLayout *l1= new QVBoxLayout;
    QLabel *Weight = new QLabel(tr("Enter your desired weight, kg:"), this);
    l1->addWidget(Weight);
    l1->addWidget(&inputWeight);
  //  l1->setSpacing(10);
   // Weight->setBuddy(&inputWeight);
    //QLabel *CurWeight = new QLabel(tr("Fat:"), this);



    //this->setCentralWidget(&centralWidget);

    QVBoxLayout *mainLayout = new QVBoxLayout(this);

    QLabel *spendCalorie = new QLabel(tr("Your fitness plan, kcal:"), this);



    //QLabel *inputCalorie = new QLabel(tr("kcal"), this);
    QHBoxLayout *layout = new QHBoxLayout();
    layout->addWidget(&inputSpend);
   // layout->addWidget(inputCalorie);
    QVBoxLayout *l2= new QVBoxLayout;
    l2->addWidget(spendCalorie);
    l2->addLayout(layout);
    //l2->setSpacing(10);
   // mainLayout->addWidget(&addButton);
    mainLayout->addLayout(inf);
    mainLayout->addLayout(l1);
    //mainLayout->addWidget(spendCalorie);
    mainLayout->addLayout(l2);
    //mainLayout->addWidget(&addGoalButton);
    mainLayout->addStretch();



   /*connect(&addGoalButton, SIGNAL(clicked()),
            this, SLOT(onAddButtonClicked()));
*/
}

/*void GoalWindow::onAddGoalClicked()
{
   bd->setGoalWeight(inputWeight.text().toInt());
   bd->setFitnessPlan(inputSpend.text().toDouble());

}*/

void GoalWindow::setWeight(Bridget *bd)
{
    curW->setText(QString::number(bd->getWeight()));
    idealW->setText(QString::number(bd->getIdealWeight()));
   /* weight=bd->getWeight();
    idealWeight=bd->getIdealWeight();*/

}
